Free PDF Background

Instant Message The Zipguy


Topics:

•  Free PDF Home & News

•  Back- ground

•  Configur- ation

Screen Flow

Download

More:

•  News

Message Board

•  Sneak Peek

•  Customers Say

•  Samples

•  Features

Alt. Method

Free PDF Chat Room


Instant
Message
Zipguy


Background


To understand what Free PDF is, what it does, and why it's hard to configure, you need to understand what the other programs do and the process involved.  

Please forgive the ZipGuy while he waxes and wanes,  You patience is appreciated

The Quest for Free PDF's


It took a long time to find a way to do this.  In order to make Free PDF's what was needed was a free program which can read output from Windows programs and write PDFs.

This is not what Free PDF does. The ZipGuy does have a life...

But after much searching (for years) the ZipGuy found that there is indeed a free (Mulitplatform!) program which can read printer output and write PDF (format)..

Holy Grail


Mysteriously, the author of this program does not tout it's capabilities.

Aladdin's Ghostscript description:
An overview of Ghostscript
Ghostscript is the name of a set of software that provides:

  • An interpreter for the PostScript TM language and the Adobe Portable Document Format (PDF -- sometimes confused with Acrobat, Adobe's PDF browser and editor product);

  • Input modules (utilities) for reading a variety of raster formats, including CMYK, GIF, JFIF (JPEG), MIFF, PBM/PGM/PPM, and PCX;

  • Output modules (drivers) for a wide variety of window systems (including X Windows and Microsoft Windows), raster file formats, and printers, as well as a PDF output module that implements functions similar to Adobe's AcrobatTM DistillerTM product; and

  • The Ghostscript library, a set of procedures to implement the graphics and filtering capabilities that are primitive operations in the PostScript language and in PDF.

In simple terms, this means that Ghostscript can read a PostScript or PDF file and display the results on the screen or convert them into a form you can print on a non-PostScript printer. Especially together with several popular previewers, with Ghostscript you can view or print an entire document or even isolated pages, even if your computer doesn't have Display PostScript and your printer doesn't handle PostScript itself.

After reading this one might think "This PDF Output Module sounds interesting!"

Most of the Windows user community uses PCL (Hewlett Packard's Page Control Language) for printer output, and furthermore don't know nor care, that that is what they are doing.  These users don't use PostScript at all.

The site description in the PDFZone Webring is even more interesting it says:

"Ghostscript home page - The Ghostscript home page contains links to a variety of freely available PostScript and PDF tools. These tools include the ability to view, print, and rasterize PostScript and PDF files, and to convert ("distill") PostScript to PDF and vice versa. They do not require any Acrobat product -- they are independent implementations of much of the Acrobat functionality. In addition to b"

Anyway, This is the holy grail in the search for a method for creating Free PDFs!

So the Good news is:
Ghostscript can write PDFs

The Bad news is:
it wants Adobe's PostScript (PS)
printer type output,
FOR INPUT!

And it has weird, complicated
positional switches and parameters

Unfortunately the ZipGuy never happens to have handy PostScript Output files lying around.


So what we need is a way to produce PostScript printer output from our windows applications.

Hmmm... Printing can create PostScript... What If we LIE to Windows?

Approach


So what we need to do from any Windows application is to create PostScript output and pump it through Ghostscript to produce PDF output.  Easier said than done.  Basically, what we do is install a printer into Windows (lie) that uses PostScript (regardless that we don't have such a printer). It is recommended to use the

'Apple LaserWriter II NT' PS Driver'

for this purpose, EVEN THOUGH WE DON'T HAVE THIS PRINTER! This is KEY!

This printer driver comes with Win9x and produces PS output.

We're ready for our first try...

First Try


We could now configure this printer to print to "FILE: (Creates a file on disk)" and we have our PS file which Ghostscript can convert.   We can use GSview (the Windows graphical front-end for Ghostscript) to convert this file into a PDF.   This WORKS, but is kludgy and awkward in practice. The Steps Involved would be:

  1. When you print you change the printer to the Apple one

  2. and get a "Save As.." Dialog for the PostScript file

  3. for which you pick a name

  4. Then you have to open up Ghostview

  5. and Open the PS file you just named

  6. You Print this to the PDF Writer

  7. And finally with another "Save as..." dialog, name the output PDF File.

7 steps... Kind of tedious and messy..We can do better than that...  Lets try again

What we need is something to kick off at step 2 and take us to step 4 and tell it the name of the PS file.  
Enter RedMon...

REDMON


RedMon is a program by Russell Lang. This program again is intended for other uses but will meet out needs nicely.  It lets you create a "redirected" port to which you can map printer(s).  This "redirected" port is watched in the background by a program which can intercept the output. When a printer prints output to this port, instead of sending the output to a printer as usual, the background RedMon Program captures the output (in our case containing PS), runs any program you like, and pumps the PS stream to that called program using something called 'pipes'.

So we install RedMon.  It lets us create a magic "redirected" port to which we can have the our Apple printer print. Cool! Whenever it prints, it will go to this port and RedMon will capture the output, and then call a program and pass it this PS output in a file. Now we're cooking!

But which program should we call?

GHOSTBUSTERS er.. Free PDF


We have to call Ghostscript eventually to do the conversion to PDF but if we use RedMon to call Ghostscript, it is real messy with lots of weird Ghostscript parameters.

In fact, here is a screen shot (which you can get by clicking the button) from Free PDF which shows us what the command would look like.

Also RedMon passes a stream of data to the STDIN "pipe" which the called program needs to be expecting.

If you want you can skip using Free PDF and call GhostView directly from the RedMon Program.  It is messy. You have to get the trailing " -" (hyphen space) just right or you can kill your print Spooler. For the adventurous, click here (Coming soon) to see how to do this.

Instead, we can do it the easy way and use RedMon's sibling program RedRun. Unlike RedMon (which passes a stream of data to the called program), RedRun writes to a temporary file and passes the name of the file to the called program. RedRun comes with RedMon.  It's in the RedMon Directory.  

Red Rover, Red Rover, Come on Over...Opps digressing... Get Back on Track

RedRun will:

  • Capture the PS output and write it to a temporary file

  • Call any program (in this case Free PDF)

  • Pass this program the name of the temporary file

  • Wait for the called program to finish

  • And delete the temporary file at the end

This is great! Don't you just hate having those temporary files accumulating in the C:\Windows\Temp directory chewing up the space on your hard drive?

What we need is another program for RedRun to Call which will simplify the call to Ghostscript and make it easier to setup this process and smoother when executing. Also with such a program we can do other things like provide a "Save as.." dialog box to place and name the output PDF rather than having the name fixed.

Enter Free PDF. This is why Free PDF was written.  We will have RedRun call Free PDF and pass it the name of the temp file and Free PDF will make the complex call to Ghostscript for us.  

Free PDF


RedRun calls Free PDF which is simple right now and growing more complex as more features are added.  

Free PDF:

  • Takes one parameter in which is the name of the input PS file

  • Provides you with a "Save PDF as" button which opens a "Save As" Dialog box

  • Calls Ghostscript passing it all those messy parameters
    (Telling Ghostscript the Name of  the Input file and which folder and name to use for the output PDF file)

  • After the PDF is created, provides a "View PDF" button which calls Acrobat Reader (free) to view it so you can see that it worked

  • Remembers the name and Folder from session to session of the output PDF file

  • Has Configurable Paths for the locations of Ghostscript and Acrobat Reader. From v0.32 and above, you can change the locations of these programs using a standard 'Open' file dialog box! To do this in older versions requires editting the file Free PDF.INI in the freepdf folder.

SECOND TRY


So now the steps for our scenario to create a PDF from an application is to print and:

  1. Point it to the 'Apple LaserWriter II NT'

and Poof!  Free PDF pops up.

Now we're cooking!

Perhaps we should rename the
printer from
'Apple LaserWriter II NT'
to
'Create PDF'.

Like This


Architecture


So Pictorally, the architecture of the whole Process looks like:

Now that you understand conceptually how it works, We're ready to move on to the details. 

Click on Configuration page to see how to do this


PDF (Portable Document Format) is
Copyright ©2000 Adobe Systems Incorporated. All rights reserved.

Brought to you by Courtesy of The
some

Free PDF

Home & News | Background | Configuration | Screen Flow | Download

more... 

News| Message Board|  Sneak Peek | Customers Say | Samples | Alt. Method | Features


Software BPath Network

Page Views: